package com.chengke.novel.service.impl;


import com.chengke.novel.cacheManager.FriendLinkCacheManager;
import com.chengke.novel.cacheManager.HomeBookCacheManager;
import com.chengke.novel.common.resp.RestResp;
import com.chengke.novel.dto.responsParm.HomeBookRespDto;
import com.chengke.novel.dto.responsParm.HomeFriendLinkRespDto;
import com.chengke.novel.service.HomeService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 首页模块 服务实现类
 * @Author CK
 * @Date 2023/03/18
 */

@Service
@RequiredArgsConstructor
public class HomeServiceImpl implements HomeService {
    private final HomeBookCacheManager homeBookCacheManager;

    private final FriendLinkCacheManager friendLinkCacheManager;

    @Override
    public RestResp<List<HomeBookRespDto>> listHomeBooks() {
        return RestResp.ok(homeBookCacheManager.listHomeBooks());
    }

    @Override
    public RestResp<List<HomeFriendLinkRespDto>> listHomeFriendLinks() {
        return RestResp.ok(friendLinkCacheManager.listFriendLinks());
    }
}
